var t = require("../../../mybehaviors/location/location"), a = getApp();

Component({
    behaviors: [ t ],
    properties: {
        datas: {
            type: null
        },
        component_id: {
            type: null
        },
        page_id: {
            type: null
        }
    },
    lifetimes: {
        attached: function() {
            var t = this;
            this.initData(), this._getLocation(function(a) {
                t.get_lawyer_list();
            }, function(t) {});
        }
    },
    data: {
        listData: []
    },
    methods: {
        get_lawyer_list: function() {
            var t = this;
            a._postNetWork({
                url: a.getNetAddresss("plugin.lawyer-platform.frontend.controllers.lawyer.getLawyerList"),
                data: {
                    lng: this.data.point.lng,
                    lat: this.data.point.lat,
                    distance_type: 1,
                    decorate_total: this.data.datas.get_number
                },
                success: function(a) {
                    if (1 == a.data.result) {
                        var e = a.data.data.list;
                        t.setData({
                            listData: e
                        });
                    }
                }
            });
        },
        initData: function() {
            var t = this.data.datas, a = t.get_number, e = t.list;
            a && e && 0 !== e.length && (this.data.listData = e.slice(0, a), this.setData({
                listData: this.data.listData
            }));
        },
        to: function(t) {
            var a = t.currentTarget.dataset.type, e = t.currentTarget.dataset.id;
            wx.navigateTo({
                url: "/packageI/lawyerPlatform/detail/detail?id=".concat(e, "&type_name=").concat(a)
            });
        }
    }
});